﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Threading;

namespace Relocation
{
	public partial class WaitForm : Form
	{
		public WaitForm(string title,string lableText)
		{
			InitializeComponent();
			this.Text = title;
			this.label1.Text = lableText;

		}

		//显示（更改）提示文字
		public void ShowText(string lableText)
		{
            this.ExecInvoker(new MethodInvoker(delegate()
            {
                this.label1.Text = lableText;
            }));          
		}

		/// <summary>
		/// 关闭窗口
		/// </summary>
		public void CloseForm()
		{
            this.ExecInvoker(new MethodInvoker(delegate()
            {
                this.Close();
            }));
		
		}

        private void ExecInvoker(MethodInvoker methodInvoker)
        {
           if (this.InvokeRequired && this.Created)
               this.Invoke(methodInvoker);
           else methodInvoker();
        }

	

	}
}
